ITK Programmer's Guide |
|||||||||||
Table of contents |
Intro | General
| TCP Low Level |
TCP High Level |
UDP | DNS
| PPP
|
A digest is like some "super-checksum" calculated on some data. They can be used as digital signatures or to transfer encrypted information.The original information cannot be recovered from the digest.
For example, MD5 digests can be used to had a digital signature to emails to ensure that the message content has not been changed (see RFC#1544).
MD5 digests are also used in the POP3 APOP command which allows user authentication with transferring the user's password (see RFC#1939).
MD5 and SHA digests are also used in the SSL protocol.
Using ITK digest calculation routines
The first step is to initialise a digest calculation using
ITK_DigestInit.
Then data are added to the calculation using the ITK_DigestAdd
and ITK_DigestBlob routines
Finally, ITK_DigestCalc is called to
get the final digest value (returned as a string).
ITK_DigestInit |
||||||||||||||||
Syntax: |
digestRef := ITK_DigestInit(digestType)
|
|||||||||||||||
Description: |
ITK_DigestInit initialises a new digest calculation and returns a digest reference which will be needed in the next step of a digest calculation (ITK_DigestAdd or ITK_DigestBlob, then ITK_DigestCalc).
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$digestRef := ITK_DigestInit(2) ` start MD2 digest calculation ITK_DigestAdd($digestRef;"Here is some text") ITK_DigestAdd($digestRef;"and some more") ITK_DigestBlob($digestRef;myBlob) $myDigest := ITK_DigestCalc($digestRef) ` get the result |
ITK_DigestAdd |
||||||||||||||||
Syntax: |
ITK_DigestAdd(digestRef;text)
|
|||||||||||||||
Description: |
Adds some text to a current digest calculation referenced by digestRef. This routine may be called several times during a digest calculation.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$digestRef := ITK_DigestInit(2) ` start MD2 digest calculation ITK_DigestAdd($digestRef;"Here is some text") ITK_DigestAdd($digestRef;"and some more") ITK_DigestBlob($digestRef;myBlob) $myDigest := ITK_DigestCalc($digestRef) ` get the result |
ITK_DigestBlob |
||||||||||||||||
Syntax: |
ITK_DigestBlob(digestRef;blob)
|
|||||||||||||||
Description: |
Adds some data contained in a blob to a current digest calculation referenced by digestRef. This routine may be called several times during a digest calculation.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$digestRef := ITK_DigestInit(2) ` start MD2 digest calculation ITK_DigestAdd($digestRef;"Here is some text") ITK_DigestAdd($digestRef;"and some more") ITK_DigestBlob($digestRef;myBlob) $myDigest := ITK_DigestCalc($digestRef) ` get the result |
ITK_DigestCalc |
|||||||||||||||||||||
Syntax: |
digest := ITK_DigestCalc(digestRef;digestFormat)
|
||||||||||||||||||||
Description: |
Terminates the digest calculation and returns the calculated digest according to the format option. After calling this routine, the digestRef previously returned by ITK_DigestInit is not valid anymore.
|
||||||||||||||||||||
Params: |
|
||||||||||||||||||||
Example: |
$digestRef := ITK_DigestInit(2) ` start MD2 digest calculation ITK_DigestAdd($digestRef;"Here is some text") ITK_DigestAdd($digestRef;"and some more") ITK_DigestBlob($digestRef;myBlob) $myDigest := ITK_DigestCalc($digestRef) ` get the result |
ITK_Rot13Text |
||||||||||||||||
Syntax: |
encodedText := ITK_Rot13Text(originalText)
|
|||||||||||||||
Description: |
Applies ROT13 "light encryption" to some text. ROT13 is an email standard to hide some text. It is not a real encryption, only a shift in characters to make some text unreadable. ROT13 is auto-reversible, apply it a second time to get
the original text back. If the original text was 7bit only, the resulting text will still be a 7bit only text.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$rot13 := ITK_Rot13Text("Hello") |
ITK_Rot13Blob |
|||||||||||
Syntax: |
ITK_Rot13Blob(theBlob)
|
||||||||||
Description: |
Applies ROT13 "light encryption" to a blob. ROT13 is an email standard to hide some data. It is not a real encryption, only a shift in characters to make some data unreadable. ROT13 is auto-reversible, apply it a second time to get the original data back. If the original data was 7bit only, the resulting data will still be a 7bit only text. The original blob is directly "encrypted" to avoid a copy in memory.
|
||||||||||
Params: |
|
||||||||||
Example: |
ITK_Rot13Blob(myBlob) |